package com.xiaoshuidi.cloud.module.contract.controller.admin.invoice;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.module.contract.service.contract.ContractInvoiceService;
import com.xiaoshuidi.cloud.module.contract.vo.CompanyInvoiceReqVO;
import com.xiaoshuidi.cloud.module.contract.vo.CompanyInvoiceRespVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 企业开票
 */
@Tag(name = "管理后台 - 发票")
@RestController
@RequestMapping("/contract/company/invoice")
public class CompanyInvoicableController {

    @Resource
    private ContractInvoiceService companyInvoiceService;

    /**
     * 企业可开票费用列表
     * @return
     */
    @GetMapping("/page")
    @Operation(summary = "企业开票列表")
    public CommonResult<PageResult<CompanyInvoiceRespVO>> invoicePage(@Valid CompanyInvoiceReqVO reqVO) {
        return CommonResult.success(companyInvoiceService.getCompanyInvoiceablePage(reqVO));
    }
}
